/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bground.sprites;

import bground.game.GameField;

/**
 *
 * @author s6_kustan_e
 */
public class Bullet extends ExtendedSprite {

    ExtendedSprite owner;

    public Bullet(ExtendedSprite owner, GameField game) {
        super("bullet", game);
        this.owner = owner;
        moveable = true;
        speed = 0.6;
        setLocation(owner.getX(), owner.getY());
        move(owner.direction, 500);
    }

    public ExtendedSprite getOwner() {
        return owner;
    }

    @Override
    protected void updateMovement(long l) {
        super.updateMovement(l);
        if (!isMoving) {
            setActive(false);
        }
    }
}

